package zhklappoint.repositoory;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.NoRepositoryBean;

@NoRepositoryBean
public interface BaseRepository<T, ID  extends Serializable> extends JpaRepository<T, ID>, JpaSpecificationExecutor<T> {

	public HashMap<String, Object> sqlQuery(String queryString, String countSql, Map<String, ?> values, int firstResult,
			int maxResults, String countName, String rowsName);

	public Page<T> queryByExampleWithRange(Example<T> example, List<Range<T>> ranges, Pageable pageable);
	
	public Page<T> sqlQuery(String queryString, String countSql, Map<String, ?> values, Pageable pageable);
	
	
	public Page<T> sqlQuery(String queryString, String countSql, Map<String, ?> values, Pageable pageable, Class<?> clazz);
	

	public HashMap<String, Object> sqlQuery(String queryString, String countSql, Map<String, ?> values, int firstResult,
			int maxResults, String countName, String rowsName, Class<?> clazz);
	
	public void sqlQuery(String queryString);
}
